package jnote;

import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import javax.swing.JTextArea;

public class Copy {   
    public void copy(Clipboard clip, JTextArea tx) {
        String text = tx.getSelectedText();
        
        if(text != null) {
            StringSelection contents = new StringSelection(text);
            clip.setContents(contents, null);
        }
    }
}
